package com.fuhao.controller;

import org.springframework.amqp.rabbit.core.RabbitAdmin;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @author zhang
 */
@RestController
public class FanSendController {
    @Autowired
    @Qualifier("rabbitFanTemplate")
    private RabbitTemplate rabbitTemplate;

    @RequestMapping("/fanSend")
    public String send(){
        Map<String,String> map = new HashMap<>();
        map.put("name","李四");
        rabbitTemplate.convertAndSend(map);
        return "success";
    }
}
